var open_menu;
var current_timeout = new Array();

function showMenu(id1)
{
  if($(id1))
  {
    if($(id1).style.display == 'none')
    {
      if($(open_menu)) { hideMenu($(open_menu)); }
      $(id1).style.display='inline';
      startMenuTimeout($(id1));
      $(id1).addEvent('mouseover', function(e) { killMenuTimeout(this); });
      $(id1).addEvent('mouseout', function(e) { startMenuTimeout(this); });
      open_menu = id1;
    }
  }
}
function killMenuTimeout(divEl)
{
  clearTimeout(current_timeout[divEl.id]);
  current_timeout[divEl.id] = '';
}
function startMenuTimeout(divEl)
{
  if(current_timeout[divEl.id] == '') {
    current_timeout[divEl.id] = setTimeout(function() { hideMenu(divEl); }, 1000);
  }
}
function hideMenu(divEl)
{
  divEl.style.display = 'none'; 
  current_timeout[divEl.id] = '';
  divEl.removeEvent('mouseover', function(e) { killMenuTimeout(this); });
  divEl.removeEvent('mouseout', function(e) { startMenuTimeout(this); });
}

   var visible_tab = 'profile';
      function loadProfileTab(tabId)
      {
        if(tabId == visible_tab)
        {
          return false;
        }
        if($('profile_'+tabId))
        {
          $('profile_tabs_'+tabId).className='profile_tab2';
          $('profile_'+tabId).style.display = "block";
          if($('profile_tabs_'+visible_tab))
          {
            $('profile_tabs_'+visible_tab).className='profile_tab';
            $('profile_'+visible_tab).style.display = "none";
          }
          visible_tab = tabId;
        }
      }
      
function ctrlEnter(event)
{
  if((event.ctrlKey) && ((event.keyCode == 0xA)||(event.keyCode == 0xD)))
      {
      document.send_form.submitbutton.click()
      }
}

function ctrlEnterWall(event)
{
  if((event.ctrlKey) && ((event.keyCode == 0xA)||(event.keyCode == 0xD)))
      {
      document.wall_form.post_wall.click()
      }
}